function checkIfAnnotated(latitude,longitude,latArr,longArr) {
	for(var i=0;i<=latArr.length;i++) {
		if(latitude==latArr[i] && longitude==longArr[i]) {
			//alert("tamam");
			mapDialog.show();
			return true;
		} else {
			if(i==latArr.length) {
				return false;
			}
		}
	}
}

function L(text) {
	var langFile = Titanium.App.Properties.getString("lang");
	var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'templates/languages/'+langFile+'.xml');
	var xmltext = file.read().text;
	var xmldata=Titanium.XML.parseString(xmltext);
	var data = xmldata.documentElement.getElementsByTagName(text);
	
return data.item(0).text;
}

function T(text) {
	var themeFile = Titanium.App.Properties.getString("theme");
	var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'templates/templates/'+themeFile+'.xml');
	var xmltext = file.read().text;
	var xmldata=Titanium.XML.parseString(xmltext);
	var data = xmldata.documentElement.getElementsByTagName(text);
	
return data.item(0).text;	
}

//jsonrpc function
function jsonRPC(url, method, params,id, callback) {
	
	var xhr = Titanium.Network.createHTTPClient();
    xhr.open("POST",url);
    xhr.onload = callback;
    var jsonClient ='{"method":'+method+',"params":['+params+'],"id":'+id+'}';
    alert(jsonClient);
	xhr.send(jsonClient);
	
} 
//xmlrpc function
function xmlrpc(url, method, params, callback)
{
    Titanium.API.info("xmlrpc: begin");
    Titanium.API.info("xmlrpc: url: " + url);
    Titanium.API.info("xmlrpc: method: " + method);
 
    var xhr = Titanium.Network.createHTTPClient();
    xhr.open("POST",url);
    xhr.onload = callback;
    var xml = '<methodCall>';
    xml += '<methodName>'+method+'</methodName>';
    xml += '<params>';
    for (var k in params)
    {
        if (k)
        {
            var p = params[k];
            Titanium.API.info("xmlrpc: p: "+p);
            xml += '<param><string>'+p+'</string></param>';
        }
    }
    xml += '</params></methodCall>';
    Titanium.API.info("xmlrpc: xml: "+xml);
    xhr.send(xml);
    Titanium.API.info("xmlrpc: end");
}

// user favorite plcae => return true or false
function userFavoritePlace (userID, placeLat, placeLong) {}
//user like place  => return true or false
function userLikePlace (userID, placeLat, placeLong) {}
//user dislike place  => return true or false
function userDislikePlace (userID, placeLat, plcaeLong) {}
//user checkin place => return true or false
function userCheckInPlace(userID, placeLat, placeLong) {}
//user follow user => return true or false
function userFollowUser(userID, followerID) {}
//user follow Place => return true or false
function userFollowPlace(userID, placeLat, placeLong) {}
//user unfollow user => return true or false
function userUnFollowUser(userID, followerID) {}
//user unfollow place => return true or false
function unFolllowPlace(userId, placeLat, placeLong) {}
//user add location => return true or false
function userAddLocation(userID, placeLat, plcaeLong,placeName, placeCategory) {}
// user confirm location => return true or false
function userConfirmLocation(userID, placeLat, plcaeLong,placeName, placeCategory) {}
//get userNearBy places => return resploneText
function getUserNearByPlaces(userID, userPlaceLat, userPlaceLong) {}
//get user near by people => return resploneText
function getUserNearByPeople(userID, userPlaceLat, userPlaceLong) {}
//get userNotification => return resploneText
function getUserNotification(userID) {}
//get user friends => return resploneText
function getUserFreinds() {}
// get user information => return resploneText
function getUserInfo(userID) {}
// get user Activity (Wall) => return resploneText => return resploneText
function getUserWall(userID) {}
// get user favorites places => return resploneText
function getUserFavoritePlaces(userID) {}
// get place profile => return resploneText
function getPlaceProfile(placeLat, placeLong) {}
//user delete activiy => return true or false
function userDeleteActivity(userID, activityID) {}
// user search place => return resploneText
function searchAboutPlace(searchText) {}
// user search people => return resploneText
function searchAboutPeople(searchText) {}
//user search All => return resploneText
function searchAboutAll(searchText) {}
//user authentication => return true or false
function userAccess(mail, password) {
	var url ='http://10.0.2.1:8000/emakan/default/call/xmlrpc';
	var method = 'xAuth';
	var params =[mail, password];
	xmlrpc(url,method,params, function(){
		return this.responseText;
	});
}